]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dash: Fix 'All apps' button position in RTL locales
authorAbderrahim Kitouni <akitouni@gnome.org>
Sat, 16 Jan 2021 17:45:07 +0000 (18:45 +0100)
committerMarge Bot <marge-bot@gnome.org>
Tue, 19 Jan 2021 13:47:06 +0000 (13:47 +0000)
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1559>

js/ui/dash.js

index a4dc7a8fb539f9fde4f67efc91af82b76473ed04..3d6e756232f1097f3e67f51cfa522c1b9d6bc850 100644 (file)
@@ -295,16 +295,27 @@ class DashActor extends St.Widget {
 
         let [appIcons, showAppsButton] = this.get_children();
         const [, showAppsNatWidth] = showAppsButton.get_preferred_width(availHeight);
+        const rtl = this.text_direction === Clutter.TextDirection.RTL;
 
         let childBox = new Clutter.ActorBox();
-        childBox.x1 = contentBox.x1;
         childBox.y1 = contentBox.y1;
-        childBox.x2 = contentBox.x2 - showAppsNatWidth;
         childBox.y2 = contentBox.y2;
+        if (rtl) {
+            childBox.x1 = contentBox.x1 + showAppsNatWidth;
+            childBox.x2 = contentBox.x2;
+        } else {
+            childBox.x1 = contentBox.x1;
+            childBox.x2 = contentBox.x2 - showAppsNatWidth;
+        }
         appIcons.allocate(childBox);
 
-        childBox.x1 = contentBox.x2 - showAppsNatWidth;
-        childBox.x2 = contentBox.x2;
+        if (rtl) {
+            childBox.x1 = contentBox.x1;
+            childBox.x2 = contentBox.x1 + showAppsNatWidth;
+        } else {
+            childBox.x1 = contentBox.x2 - showAppsNatWidth;
+            childBox.x2 = contentBox.x2;
+        }
         showAppsButton.allocate(childBox);
     }